import request from '../../utils/request'
import { login, register, token, delFriendType } from "./type";
enum API {
    LOGIN = '/user/login',
    REGISTER = '/user/register',
    GETTOKEN = '/user/token',
    USERLIST = '/user/list',
    USERINFO = '/user/userInfo',
    DELFRIEND = '/user/delFriend',
}

export const getLogin = (data: login) => request.post(API.LOGIN, data)
export const getRegister = (data: register) => request.post(API.REGISTER, data)
export const getToken = (data: token) => request.post(API.GETTOKEN, data)
export const getUserList = (data: string) => request.get(`${API.USERLIST}?keyword=${data}`)
export const getUserInfo = (data: string) => request.get(`${API.USERINFO}?id=${data}`)
export const delFriend = (data: delFriendType) => request.post(`${API.DELFRIEND}`, data)